const {
  mysql
} = require('../qcloud');

module.exports = async ctx => {
  let query = ctx.request.query;
  if (query.id) {
    await mysql('music').increment('counter', 1).where('id', query.id);
    ctx.state.data = {
      msg: 'success'
    }
  } else {
    await mysql('video').increment('counter', 1).where('id', query.vid);
    ctx.state.data = {
      msg: 'success'
    }
  }

}
